﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CSP.Model.CSP;
using CSP.Model.CSPEnum;

namespace CSP.Dao.IObjectDaos.CSP
{
    public interface ICreditLineDao : ICSPDao<CreditLine>
    {
        /// <summary>
        /// 根据评价用户,被评价用户和订单编号
        /// </summary>
        /// <param name="toUserName"></param>
        /// <param name="orderNumber"></param>
        /// <returns></returns>
        int FindCountByUsersAndOrderNumber(string fromUserName, string toUserName, string orderNumber);

        /// <summary>
        /// 根据服务者用户名获取来自消费者的评价
        /// </summary>
        /// <param name="toUserName"></param>
        /// <returns></returns>
        List<int> FindIdsFromConsumeByServiceUser(string serviceUserName);

        /// <summary>
        /// 根据消费者用户名获取来自服务者的评价
        /// </summary>
        /// <returns></returns>
        List<int> FindIdsFromServiceByConsumeUser(string consumeUserName);

        /// <summary>
        /// 获取给他人的评价
        /// </summary>
        /// <param name="fromUser"></param>
        /// <returns></returns>
        List<int> FindIdsByFromUser(string fromUser);

        /// <summary>
        /// 根据服务Id 获取来自消费者给课程的评价Ids
        /// </summary>
        /// <param name="serviceId"></param>
        /// <returns></returns>
        List<int> FindIdsFromConsumeByServiceId(int serviceId);

        /// <summary>
        /// 根据评价Ids 获取来评论不等于空的Ids
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="contentType">0 无内容 ，1有内容</param>
        /// <returns></returns>
        List<int> FindIdsByIdsAndContentType(List<int> ids, int contentType);

        /// <summary>
        /// 根据评价Ids 获取来评论不等于空的Ids
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        List<int> FindIdsByIdsAndCreditRatingType(List<int> ids, CreditRatingType creditRatingType);

        /// <summary>
        /// 据Ids 及分页参数获取数据
        /// </summary>
        /// <param name="ids"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        ICollection<CreditLine> GetCreditLineByIds(List<int> ids, int pageIndex, int pageSize);


    }
}
